package com.wantupai.app.utils;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.telephony.TelephonyManager;

import java.util.List;

import static android.content.Context.TELEPHONY_SERVICE;

/**
 * Created by wmq on 2019/4/24.
 */

public class ConfigUtils {

    @SuppressLint("MissingPermission")
    public static String getDeviceId(Context context){
        TelephonyManager TelephonyMgr = (TelephonyManager)context.getSystemService(TELEPHONY_SERVICE);
        return TelephonyMgr.getDeviceId();
    }

    public static  int getVersionCode() {
        int versionCode = 0;
        try {
            versionCode = AppUtils.getSspComtext().getPackageManager().
                    getPackageInfo(AppUtils.getSspComtext().getPackageName(), 0).versionCode;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return versionCode;
    }


}
